<?php

/**
 * banner filter form base class.
 *
 * @package    zobee
 * @subpackage filter
 * @author     Gabriel Martinez Rojas
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasebannerFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'titulo_banner1'     => new sfWidgetFormFilterInput(),
      'titulo_banner2'     => new sfWidgetFormFilterInput(),
      'orden_banner'       => new sfWidgetFormFilterInput(),
      'titulo_articulo'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'contenido_articulo' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'imagen_banner'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'imagen_descripcion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'titulo_banner1'     => new sfValidatorPass(array('required' => false)),
      'titulo_banner2'     => new sfValidatorPass(array('required' => false)),
      'orden_banner'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'titulo_articulo'    => new sfValidatorPass(array('required' => false)),
      'contenido_articulo' => new sfValidatorPass(array('required' => false)),
      'imagen_banner'      => new sfValidatorPass(array('required' => false)),
      'imagen_descripcion' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('banner_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'banner';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'titulo_banner1'     => 'Text',
      'titulo_banner2'     => 'Text',
      'orden_banner'       => 'Number',
      'titulo_articulo'    => 'Text',
      'contenido_articulo' => 'Text',
      'imagen_banner'      => 'Text',
      'imagen_descripcion' => 'Text',
    );
  }
}
